package com.glela.domain.vo;

import com.glela.platform.model.request.RequestBaseModel;

public class RequestRedPacketPageBaseModel extends RequestBaseModel{
	/**
	 * 
	 */
	private static final long serialVersionUID = -8993726939861318222L;
	private Integer pageSize;
	private Integer page;
	
	public Integer getPageSize() {
		if (pageSize == null) {
			pageSize = 20;
		} else if (pageSize > 50) {
			pageSize = 20;
		}
		return pageSize;
	}
	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}
	public Integer getPage() {
		if (page == null) {
			page = 1;
		} else if (page == 0) {
			page = 1;
		}
		return page;
	}
	public void setPage(Integer page) {
		this.page = page;
	}
	
	public int getStartIndex() {
		return (getPage() - 1) * getPageSize();
	}
}
